home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Examples / Text / Include / RulerFacet.h < prev    next >
Encoding:
Text File  |  1994-04-21  |  1.7 KB  |  64 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                            RulerFacet.h
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Author:                        Anthone Burbidge
  7. //    Creation Date:        3/28/94
  8. //
  9. //    Copyright:    © 1993, 1994 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //========================================================================================
  12.  
  13. #ifndef _RULERFACET_
  14. #define _RULERFACET_
  15.  
  16. #ifndef _TEXTPART_
  17. #include "TextPart.h"
  18. #endif
  19.  
  20. // ----- Framework Includes -----
  21.  
  22. #ifndef FWFACET_H
  23. #include "FWFacet.h"
  24. #endif
  25.  
  26.  
  27. //========================================================================================
  28. // CLASS CRulerFacet
  29. //========================================================================================
  30.  
  31. class CRulerFacet : public FW_CFacet
  32. {
  33. private:
  34.     static const RGBColor kGray;
  35.     static const RGBColor kBlack;
  36.     
  37. // ----- Construction/destruction
  38. public:
  39.     CRulerFacet();
  40.     void IRulerFacet(XMPFacet* facet, CTextPart* textPart);
  41.     virtual ~CRulerFacet();
  42.  
  43. // ----- Inherited API
  44. public:
  45.     virtual void             Draw(FW_CGraphicContext *gc);
  46.     virtual FW_Boolean        DoMouseDown(const FW_CPoint& where,
  47.                                          XMPEventData event);
  48.     virtual void            MouseEnter(const FW_CPoint& where);
  49.  
  50. // ----- New API
  51. protected:
  52.     virtual void            DrawBackground(FW_PlatformRegion invalidRgn, const FW_SPlatformRect& boundingBox);
  53.     virtual void            DrawTools(FW_PlatformRegion invalidRgn, const FW_SPlatformRect& boundingBox);
  54.     virtual void            DrawRuler(FW_PlatformRegion invalidRgn, const FW_SPlatformRect& boundingBox);
  55.  
  56. // ----- Fields
  57. private:
  58.     CTextPart*                fTextPart;
  59.     FW_SPlatformRect                    fToolAreas[CTextPart::kNumberOfTools];
  60.     short                    fSelectedTool;
  61. };
  62.  
  63. #endif
  64.